package com.ssy.lingxi.member.merchant.model.vo.maintenance.response;

import cn.hutool.core.util.StrUtil;
import com.ssy.lingxi.common.constant.CommonConstant;

import java.io.Serializable;

/**
 * 门店管理分页查询返回结果参数VO
 * @author wyx
 * @version 2.0.0
 * @date 2022-02-14
 **/
public class MemberStorePageQueryVO implements Serializable {
    private static final long serialVersionUID = -2157865503670893706L;

    /**
     * 主键id
     */
    private Long id;

    /**
     * 门店代码
     */
    private String code;

    /**
     * 门店名称
     */
    private String name;

    /**
     * 省名称
     */
    private String provinceName;

    /**
     * 市名称
     */
    private String cityName;

    /**
     * 区名称
     */
    private String districtName;

    /**
     * 街道名称
     */
    private String streetName;

    /**
     * 详细地址
     */
    private String address;

    /**
     * 邮政编码
     */
    private String postalCode;

    /**
     * 联系人姓名
     */
    private String contactName;

    /**
     * 国家编码（手机号码前缀）
     */
    private String countryCode;

    /**
     * 所属组织机构
     */
    private String orgName;

    /**
     * 手机号码
     */
    private String phone;

    /**
     * 门店地址
     */
    private String fullAddress;

    /**
     * 状态，0-停用，1-启用
     */
    private Integer status;

    /**
     * 是否显示“启用”按钮
     */
    private Boolean showEnable;

    /**
     * 是否显示“修改”按钮
     */
    private Boolean showUpdate;

    /**
     * 是否显示“删除”按钮
     */
    private Boolean showDelete;

    public MemberStorePageQueryVO() {
    }

    public MemberStorePageQueryVO(Long id, String code, String name, String provinceName, String cityName, String districtName, String streetName, String address, String postalCode, String contactName, String countryCode, String orgName, String phone, Integer status) {
        this.id = id;
        this.code = code;
        this.name = name;
        this.provinceName = provinceName;
        this.cityName = cityName;
        this.districtName = districtName;
        this.streetName = streetName;
        this.address = address;
        this.postalCode = postalCode;
        this.contactName = contactName;
        this.countryCode = countryCode;
        this.orgName = orgName;
        this.phone = phone;
        String pro = StrUtil.isNotEmpty(provinceName) ? provinceName : "";
        String cit = StrUtil.isNotEmpty(cityName) ? cityName : "";
        String dis = StrUtil.isNotEmpty(districtName) ? districtName : "";
        String str = StrUtil.isNotEmpty(streetName) ? streetName : "";
        String add = StrUtil.isNotEmpty(address) ? address : "";
        this.fullAddress = pro + cit + dis + str + add;
        this.status = status;
        this.showEnable = status.equals(CommonConstant.State.STATE_START);
        //无效状态可以修改和删除门店
        this.showUpdate = status.equals(CommonConstant.State.STATE_STOP);
        this.showDelete = status.equals(CommonConstant.State.STATE_STOP);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getStreetName() {
        return streetName;
    }

    public void setStreetName(String streetName) {
        this.streetName = streetName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPostalCode() {
        return postalCode;
    }

    public void setPostalCode(String postalCode) {
        this.postalCode = postalCode;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getCountryCode() {
        return countryCode;
    }

    public void setCountryCode(String countryCode) {
        this.countryCode = countryCode;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getFullAddress() {
        return fullAddress;
    }

    public void setFullAddress(String fullAddress) {
        this.fullAddress = fullAddress;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Boolean getShowEnable() {
        return showEnable;
    }

    public void setShowEnable(Boolean showEnable) {
        this.showEnable = showEnable;
    }

    public Boolean getShowUpdate() {
        return showUpdate;
    }

    public void setShowUpdate(Boolean showUpdate) {
        this.showUpdate = showUpdate;
    }

    public Boolean getShowDelete() {
        return showDelete;
    }

    public void setShowDelete(Boolean showDelete) {
        this.showDelete = showDelete;
    }
}
